#include <iostream>
#include <vector>
using namespace std;

class Solution
{
public:
    inline bool Find(int target, vector<vector<int>> &array, int xs, int xe, int ys, int ye)
    {
        // 处理一行或一个元素
        if (xe == xs)
        {
            if (ys == ye)
            {
                if (array[xs][ys] == target)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                for (int i = ys; i <= ye; i++)
                {
                    if (array[xs][i] == target)
                    {
                        return true;
                    }
                }
                return false;
            }
        }
        // 处理一行或一个元素
        if (ye == ys)
        {
            if (xs == xe)
            {
                if (array[xs][ys] == target)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                for (int i = xs; i <= xe; i++)
                {
                    if (array[i][ys] == target)
                    {
                        return true;
                    }
                }
                return false;
            }
        }
        // 找出对角线上大于target的数
        int i = 0;
        for (; xs + i <= xe && ys + i <= ye; i++)
        {
            if (array[xs + i][ys + i] > target)
            {
                break;
            }
            if (array[xs + i][ys + i] == target)
            {
                return true;
            }
        }
        // 全部小于target
        if (i == 0)
        {
            return false;
        }

        // x方向已然到头
        if (xs + i > xe)
        {
            if (ys + i > ye)
            {
                // y方向结束
                return false;
            }
            else
            {
                // y方向有剩余数据
                return Find(target, array, xs, xe, ys + i + 1, ye);
            }
        }

        if (ys + i > ye)
        {
            if (xs + i > xe)
            {
                return false;
            }
            else
            {
                return Find(target, array, xs + i + 1, xe, ys, ye);
            }
        } 
        // 找到对角线上大于target的数字
        bool fl = Find(target, array, xs, xs + i - 1, ys + i, ye);
        bool fr = Find(target, array, xs + i, xe, ys, ys + i - 1);
        return fr || fl;
    }
    bool Find(int target, vector<vector<int>> array)
    {
        const int length = array[0].size() - 1;
        return Find(target, array, 0, length, 0, length);
    }
};

int main()
{
    vector<vector<int>> array;
    vector<int> a1{1, 2, 8, 9};
    vector<int> a2{2, 4, 9, 12};
    vector<int> a3{4, 7, 10, 13};
    vector<int> a4{6, 8, 11, 15};
    array.push_back(a1);
    array.push_back(a2);
    array.push_back(a3);
    array.push_back(a4);
    Solution so;
    while (1)
    {
        int i;
        cin >> i;
        if (i < 0)
            break;
        bool res = so.Find(i, array);
        cout << "Find: " << res << endl;
    }
    // cout << "Find: " << so.Find(1, array) << endl;;
    return 0;
}